from cola.common import code as code_const
from cola.util.id_worker import worker


# 返回成功的格式
def success(data=None, msg=None):
    return {
        'code': code_const.SUCCESS,
        'data': data,
        'msg': msg,
        'sign': str(worker.get_id())
    }


# 返回自定义的格式
def go_back(code, data=None, msg=None):
    return {
        'code': code,
        'data': data,
        'msg': msg,
        'sign': str(worker.get_id())
    }
